<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1">
    <title>发布信息</title>
    <link rel="stylesheet" href="../../front/css/common.css">
    <script type="text/javascript" src="../../front/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../front/js/common.js"></script>
</head>
<body>
<div class="ly_header header2">发布信息
    <div class="ly_left goindex"><img src="../../front/image/gobackbai.png" alt=""></div>
</div>
<div id="appactivity" style="margin-bottom: 49px">
    <div style="background: white;padding: 0 15px;">
        <div class="box2 left dw">
            <img src="../../front/newimg/informationreleaseselect.png" style="height: 71px;width:100%;" alt="">
            <div class="dw_text5">发布的信息</div>
        </div>
        <div class="box2 left dw showhide" boxshow="#signactivity" boxhide="#appactivity">
            <img src="../../front/newimg/Informationresponse.png" class="" style="height: 71px;width:100%" alt="">
            <div class="dw_text5">信息的响应</div>
        </div>
        <div style="clear: both"></div>
    </div>
    <div id="appactivitylist">

    </div>
</div>
<div id="signactivity"  style="margin-bottom: 49px" class="hide">
    <div style="background: white;padding: 0 15px">
        <div class="box2 left dw showhide" boxshow="#appactivity" boxhide="#signactivity">
            <img src="../../front/newimg/informationrelease.png" class="" style="height: 71px;width: 100%;" alt="">
            <div class="dw_text5">发布的信息</div>
        </div>
        <div class="box2 left dw">
            <img src="../../front/newimg/Informationresponseselect.png" style="height: 71px;width: 100%;" alt="">
            <div class="dw_text5">信息的响应</div>
        </div>
        <div style="clear: both"></div>
    </div>
    <div class="activitylist boederbottom mard5">
        <div>
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">任务名称
        </div>
        <div>
            <div class="" style="font-size: 0.9em;">
                <div>
                    <span class="color6">状态</span><span class="hdbmz padl5">活动已赞赏</span>
                </div>
                <div class="color6" style="font-size: 0.8em">时间：2019-1-11/8:25:25</div>
            </div>
        </div>
        <div style="font-size: 0.7em;">
            <span class="">响应人数：10</span>
        </div>
        <div class="color6" style="font-size: 0.8em">联系人：威威威</div>
        <div class="color6" style="font-size: 0.8em">邮箱：11111@qq.com</div>
        <div class="color6" style="font-size: 0.8em">联系电话：13312312312</div>

    </div>
    <div class="activitylist boederbottom mard5">
        <div>
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">任务名称
        </div>
        <div>
            <div class="" style="font-size: 0.9em;">
                <div>
                    <span class="color6">状态</span><span class="hdbmz padl5">活动已赞赏</span>
                </div>
                <div class="color6" style="font-size: 0.8em">时间：2019-1-11/8:25:25</div>
            </div>
        </div>
        <div style="font-size: 0.7em;">
            <span class="">响应人数：10</span>
        </div>
        <div class="color6" style="font-size: 0.8em">联系人：威威威</div>
        <div class="color6" style="font-size: 0.8em">邮箱：11111@qq.com</div>
        <div class="color6" style="font-size: 0.8em">联系电话：13312312312</div>

    </div>
    <div class="activitylist boederbottom mard5">
        <div>
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">任务名称
        </div>
        <div>
            <div class="" style="font-size: 0.9em;">
                <div>
                    <span class="color6">状态</span><span class="hdbmz padl5">活动已赞赏</span>
                </div>
                <div class="color6" style="font-size: 0.8em">时间：2019-1-11/8:25:25</div>
            </div>
        </div>
        <div style="font-size: 0.7em;">
            <span class="">响应人数：10</span>
        </div>
        <div class="color6" style="font-size: 0.8em">联系人：威威威</div>
        <div class="color6" style="font-size: 0.8em">邮箱：11111@qq.com</div>
        <div class="color6" style="font-size: 0.8em">联系电话：13312312312</div>

    </div>
    <div class="activitylist boederbottom mard5">
        <div>
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">任务名称
        </div>
        <div>
            <div class="" style="font-size: 0.9em;">
                <div>
                    <span class="color6">状态</span><span class="hdbmz padl5">活动已赞赏</span>
                </div>
                <div class="color6" style="font-size: 0.8em">时间：2019-1-11/8:25:25</div>
            </div>
        </div>
        <div style="font-size: 0.7em;">
            <span class="">响应人数：10</span>
        </div>
        <div class="color6" style="font-size: 0.8em">联系人：威威威</div>
        <div class="color6" style="font-size: 0.8em">邮箱：11111@qq.com</div>
        <div class="color6" style="font-size: 0.8em">联系电话：13312312312</div>

    </div>
    <div class="activitylist boederbottom mard5">
        <div>
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">任务名称
        </div>
        <div>
            <div class="" style="font-size: 0.9em;">
                <div>
                    <span class="color6">状态</span><span class="hdbmz padl5">活动已赞赏</span>
                </div>
                <div class="color6" style="font-size: 0.8em">时间：2019-1-11/8:25:25</div>
            </div>
        </div>
        <div style="font-size: 0.7em;">
            <span class="">响应人数：10</span>
        </div>
        <div class="color6" style="font-size: 0.8em">联系人：威威威</div>
        <div class="color6" style="font-size: 0.8em">邮箱：11111@qq.com</div>
        <div class="color6" style="font-size: 0.8em">联系电话：13312312312</div>

    </div>
</div>
<div class="bottombtn" style="">
    <a th:href="@{/front/publishInfo/toAppinforrelease.action}">
        <img src="../../front/newimg/sqfbxx.png" style="height: 49px;width: 100%;" alt="">
    </a>
</div>
</body>
<script type="text/javascript" src="../../front/js/information.js"></script>
<script>
    function appactivity(data){
        var temp='<div class="activitylistmain mard5"><div class="activitylist boederbottom">'
                    +'<div>'
                        +'<img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">'+data.infoName
                    +'</div>'
                    +'<div>'
                        +'<div class="" style="font-size: 0.9em;">'
                            +'<div>'
                                +'<span class="color6">活动状态</span>'
                                switch(data.infoStatus){
                                    case 'UN_AUDIT':temp+='<span class="sqshtg padl5 ">申请待审核</span>';
                                            break;
                                    case 'APPLY_CANCEL':temp+='<span class="sqshtg padl5">申请取消</span>';
                                            break;
                                    case 'AUDIT_PASS':temp+='<span class="sqshtg padl5">申请审核通过</span>';
                                            break;
                                    case 'AUDIT_FAIL':temp+='<span class="sqshtg padl5">申请审核不通过</span>';
                                            break;
                                    case 'INFO_SIGN_UP':temp+='<span class="sqshtg padl5">信息报名中</span>';
                                            break;
                                    case 'INFO_IN_PROGRESS':temp+='<span class="sqshtg padl5">信息实施进行中</span>';
                                            break;
                                    case 'INFO_CANCEL':temp+='<span class="sqshtg padl5">信息取消</span>';
                                            break;
                                    case 'INFO_FINISHED':temp+='<span class="sqshtg padl5">信息结束</span>';
                                            break;
                                    case 'INFO_APPRECIATED':temp+='<span class="sqshtg padl5">活动已赞赏</span>';
                                            break;
                                }
                                temp+='</div>'
                            +'<div class="color6" style="font-size: 0.8em">'+data.createTimeStr+'</div>'
                        +'</div>'
                    +'</div>'
                +'</div>'
                +'<div class="cancelrelease">'
                    +'<div class="box75 left"><div class="" style="font-size: 0.8em">'+data.createTimeStr+'</div></div>'
                    +'<div class="box4 left">'
                    if(data.infoStatus=='UN_AUDIT'){
                        temp+='<img src="../../front/newimg/qxfbbtn.png" class="unpublish" unpublish="'+data.id+'"  style="height:25px" alt="">'
                    }

                    temp+='</div>'
                    +'<div style="clear: both"></div>'
                +'</div></div>'
        return temp;
    }
    function signactivity(data){

    }
    $(document).on("click",".unpublish",function(){
        var id=$(this).attr("unpublish");
        var that=$(this);
        $.ajax({
            url: "cancel.action",
            type: "post",
            data: {id:id}, //发送数据,
            dataType: "json",
            async: false,
            success: function(data){
                if(data.success){
                    $(that).remove();
                    console.log($(that).parent().parent().parent())
                    console.log($(that).parent())
                    console.log($(that).parent().parent())
                    console.log($(that).parent().parent().parent().find(".sqshtg"))
                    $(that).parent().parent().parent().find(".sqshtg").text("申请取消");
                }
            },
            error:function(){
                alert("失败")
            }
         })
    })
    $(document).on("click",".goindex",function(){
        window.location.href='../memberCenter/toIndex.action'
    })
    var l=1;
    var ls=1;
    $(function(){
        $.ajax({
            url: "publishedInfoList.action",
            type: "post",
            data: {currentPage:l,pageSize:10}, //发送数据,
            dataType: "json",
            async: false,
             success: function(data){
                var temp=''
                for(var i=0;i<data.resultList.length;i++){
                    temp+=appactivity(data.resultList[i]);
                }
                $("#appactivitylist").append(temp);
                l++;
             },
             error:function(){
                alert()
             }
        })
        $.ajax({
            url: "querySignUpPublishedInfoList.action",
            type: "post",
            data: {currentPage:ls,pageSize:10}, //发送数据,
            dataType: "json",
            async: false,
            success: function(data){
                console.log(data)
                ls++;
            },
            error:function(){
                alert()
            }
        })
    })
    $(window).scroll(function () {
        if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
            $.ajax({
                url: "publishedInfoList.action",
                type: "post",
                data: {currentPage:l,pageSize:10}, //发送数据,
                dataType: "json",
                async: false,
                 success: function(data){
                    var temp=''
                    for(var i=0;i<data.resultList.length;i++){
                        temp+=appactivity(data.resultList[i]);
                    }
                    $("#appactivitylist").append(temp);
                    l++;
                 },
                 error:function(){
                    alert()
                 }
            });
        }
        if ($(document).scrollTop() <= 0) {
            $.ajax({
            url: "publishedInfoList.action",
            type: "post",
            data: {currentPage:1,pageSize:10}, //发送数据,
            dataType: "json",
            async: false,
             success: function(data){
                var temp=''
                for(var i=0;i<data.resultList.length;i++){
                    temp+=appactivity(data.resultList[i]);
                }
                $("#appactivitylist").html(temp);
                l=0;
             },
             error:function(){
                alert()
             }
         })
        }
    })
</script>
</html>